/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exception;

import modele.Department;
import modele.Employee;

/**
 *
 * @author Alex
 */
public class EmployeeAlreadyInDepartment extends Exception {
    protected Employee emp;
    protected Department dpt;
    
    public EmployeeAlreadyInDepartment(Employee emp, Department dpt) {
        this.emp = emp;
        this.dpt = dpt;
    }
    
    @Override
    public String toString() {
        return "The employee '" + emp.getFirstName() + " " 
                + emp.getLastName() + "' is already registered in department '"
                + dpt.getName() + "'.";
    }
    
}
